import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import 'normalize.css'
import '@/assets/css/base.css'
import '@/assets/css/common.css'
import dayjs from 'dayjs'
import { v4 as uuidv4 } from 'uuid';

Vue.config.productionTip = false

Vue.prototype.$dayjs = dayjs

Vue.prototype.$uuidv4=uuidv4;

// 定义一个空对象，用于存放消息方法
const msgPlugin = {};
// 定义四个方法，并将它们挂载到 msgPlugin 上
msgPlugin.install = function (Vue, options) {
  Vue.prototype.$showInfoMsg = function (msg) {
    this.$message(msg);
  };

  Vue.prototype.$showSuccessMsg = function (msg) {
    this.$message({
      message: msg,
      type: 'success'
    });
  };

  Vue.prototype.$showWarningMsg = function (msg) {
    this.$message({
      message: msg,
      type: 'warning'
    });
  };

  Vue.prototype.$showErrorMsg = function (msg) {
    this.$message.error(msg);
  };
};

// 使用插件
Vue.use(msgPlugin);

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
